package com.demo.service;
import com.demo.mapper.UserMapper;

public class UserService {
    private UserMapper userMapper=null;

    //Spring会调用setter方法注入依赖项
    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    public void save(){
        System.out.println("--执行UserService.save()");
        this.userMapper.save();
    }
}